package com.third.customer.site.controller.req;

import com.third.customer.model.dao.param.UserParam;
import com.third.customer.model.data.UserType;
import lombok.Data;

/**
 * Created by hehuaichun on 2020/5/20.
 */
@Data
public class UserQueryReq {

    private String name;
    private UserType type;
    private int page = 0;
    private int limit = 10;

    public UserParam toParam(Long companyId) {
        UserParam param = new UserParam();
        param.setCompanyId(companyId);
        param.setName(name);
        if (type != null) {
            param.setType(type.getCode());
        }
        param.setPage(page);
        param.setLimit(limit);
        return param;
    }
}
